package fatworm.query.constant;

import fatworm.util.Lib;

public class DateConstant implements Constant {
	
	private DateTime val;
	
	public DateConstant(String val) {
		this.val = new DateTime(val);
	}
	
	public Object asJavaVal() {
		return val;
	}
	
	public boolean equals(Object obj) {
		DateTime dt = (DateTime)obj;
		return val.equals(dt);
	}
	
	public int compareTo(Constant c) {
		DateTime dt = (DateTime)c.asJavaVal();
		return val.compareTo(dt);
	}
	
	public int hashCode() {
		return val.hashCode();
	}
	
	public String toString() {
		return val.toString();
	}
	
	public Constant plus(Constant c) {
		Lib.assertNotReached();
		return null;
	}
}